package learning.pcfg.model;

import java.util.List;

public class Grammar {

	public List<TerminalProduction> terminalProductions;
	
	public List<InnerProduction> innerProductions;
	
	public Grammar(List<TerminalProduction> terminalProductions,
			List<InnerProduction> innerProductions) {
		this.terminalProductions = terminalProductions;
		this.innerProductions = innerProductions;
	}
	
	
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("[TERMINALS]\n");
		for (TerminalProduction tp : terminalProductions)
			sb.append(tp.toString() + " ");
		sb.append("\n");
		sb.append("[PRODUCTIONS]\n");
		for (InnerProduction ip : innerProductions)
			sb.append(ip.toString() + "\n");
		return sb.toString();
	}
}
